<template>
  <view class="container">
    <view class="intro">
      <u--image src="/static/logo.png" width="100" height="100"></u--image>
      <view class="tips">
        一杯好茶
        <br />
        遇见美好
      </view>
    </view>
    <view class="bottom">
      <!-- <up-button type="success" open-type="getPhoneNumber" icon="weixin-fill" text="微信一键登录"></up-button> -->
      <up-button type="success" @click="toWxLogin" icon="weixin-fill" text="微信一键登录"></up-button>
      <view class="hint">
        登录代表同意
        <text class="link">用户协议、隐私政策，</text>
        并授权使用您的账号信息（如昵称、头像、收获地址）以便您统一管理
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import {useWxAuth} from "@/hooks/web/useWxAuth"
// 微信登录
const toWxLogin = async () => {
  useWxAuth().toWxLogin()
};
const login = () => { 
	uni.navigateBack()
}
</script>

<style lang="scss" scoped>
.intro {
  width: 100%;
  height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  image {
    width: 165rpx;
    height: 165rpx;
  }

  .tips {
    line-height: 72rpx;
    text-align: center;
  }
}

.bottom {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 40rpx;

  .login-btn {
    width: 100%;
    border-radius: 50rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10rpx 0;

    image {
      width: 36rpx;
      height: 30rpx;
      margin-right: 10rpx;
    }
  }

  .row {
    .grid {
      width: 20%;
      image {
        width: 60rpx;
        height: 60rpx;
        margin-bottom: 10rpx;
      }
    }
  }
}

.hint {
  padding: 20rpx 40rpx;
  font-size: 20rpx;
  color: $u-tips-color;

  .link {
    color: $u-warning;
  }
}
</style>
